<meta charset="UTF-8">
<style type="text/css">
.modal-header h4{
	font-size: 25px;
}
</style>
<div th:if="${g_change.size() == 0}">
	<center><img src="static/img/empty.jpg" width="40%"></center>
</div>
<div th:if="${g_change.size() != 0}">
<table class="table table-bordered table-hover ">
	<tr>
		<th>申请老师</th>
		<th>申请时间</th>
		<th>上课时间</th>
		<th>节次</th>
		<th>上课地点</th>
		<th>课程名称</th>
		<th>上课班级</th>
		<th>调后老师</th>
		<th>调后地点</th>
		<th>调后时间</th>
		<th>星期</th>
		<th>调后节次</th>
		<th>状态</th>
		<th colspan="2">操作</th>

	</tr>
	<tr th:each="chan:${g_change}">
		<td th:text="${chan.user.name}"></td>
		<td th:text="${chan.opplyTime}"></td>
		<td th:text="${chan.suspendTime}"></td>
		<td th:text="${chan.section}"></td>
		<td th:text="${chan.classroom}"></td>
		<td th:text="${chan.curriculum}"></td>
		<td th:text="${chan.tbClass}"></td>
		<td th:text="${chan.teacher}"></td>
		<td th:text="${chan.address}"></td>
		<td th:text="${chan.repairTime}"></td>
		<td th:text="${chan.week}"></td>
		<td th:text="${chan.jc}"></td>
		<td th:text="${chan.state}"></td>
		<td>
			<button class="btn btn-success btn-sm" th:onclick="'javascript:g_agree1(\''+${chan.id}+'\')'"><span class="glyphicon glyphicon-ok"></span>同意</button>
			<button class="btn btn-danger btn-sm" th:onclick="'javascript:g_refuse1(\''+${chan.id}+'\')'"><span class="glyphicon glyphicon-remove"></span>拒绝</button>
		</td>
	</tr>
</table>
</div>
<script>
	function g_agree1(id){
		bootbox.confirm({
			title:'<span class="glyphicon glyphicon-question-sign"></span> 提示信息',
			message: '<h4>确定同意吗？</h4>',
			buttons: {
	            cancel: {
	                label: '<i class="glyphicon glyphicon-remove"></i> 取消'
	            },
	            confirm: {
	                label: '<i class="glyphicon glyphicon-ok"></i> 确定'
	            }
	        },
	        callback: function (result) {
	        	if(result==true){
	        		$.post('ttb/agreeController',{id:id, a:1},function(data){
	        			$('#g_main').load('ttb/g_adminTtb1');
	        			bootbox.alert(data.msg);
	        		});
	        	}
	        }
		});
	}
	function g_refuse1(id){
		 bootbox.prompt({
		    	locale:'zh_CN',
		    	size: '',
		    	title:'相关意见',
		        inputType: 'textarea',
		        callback: function (result) {
		            if(result != null){
		            	$.post('ttb/agreeController',{id:id, a:2, result: result},function(data){
		        			$('#g_main').load('ttb/g_adminTtb1');
		        			bootbox.alert(data.msg);
		        		});
		            }
		        }
		    });
	}
</script>